package c.b.a.b.c0;

import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Path;
import android.graphics.RectF;
import java.util.ArrayList;
import java.util.List;

public class m {
    @Deprecated

    /* renamed from: a  reason: collision with root package name */
    public float f1856a;
    @Deprecated

    /* renamed from: b  reason: collision with root package name */
    public float f1857b;
    @Deprecated

    /* renamed from: c  reason: collision with root package name */
    public float f1858c;
    @Deprecated

    /* renamed from: d  reason: collision with root package name */
    public float f1859d;
    @Deprecated
    public float e;
    @Deprecated
    public float f;
    private final List<f> g = new ArrayList();
    private final List<g> h = new ArrayList();

    class a extends g {

        /* renamed from: b  reason: collision with root package name */
        final /* synthetic */ List f1860b;

        /* renamed from: c  reason: collision with root package name */
        final /* synthetic */ Matrix f1861c;

        a(m mVar, List list, Matrix matrix) {
            this.f1860b = list;
            this.f1861c = matrix;
        }

        public void a(Matrix matrix, c.b.a.b.b0.a aVar, int i, Canvas canvas) {
            for (g a2 : this.f1860b) {
                a2.a(this.f1861c, aVar, i, canvas);
            }
        }
    }

    static class b extends g {

        /* renamed from: b  reason: collision with root package name */
        private final d f1862b;

        public b(d dVar) {
            this.f1862b = dVar;
        }

        public void a(Matrix matrix, c.b.a.b.b0.a aVar, int i, Canvas canvas) {
            float h = this.f1862b.m();
            float i2 = this.f1862b.n();
            aVar.a(canvas, matrix, new RectF(this.f1862b.k(), this.f1862b.o(), this.f1862b.l(), this.f1862b.j()), i, h, i2);
        }
    }

    static class c extends g {

        /* renamed from: b  reason: collision with root package name */
        private final e f1863b;

        /* renamed from: c  reason: collision with root package name */
        private final float f1864c;

        /* renamed from: d  reason: collision with root package name */
        private final float f1865d;

        public c(e eVar, float f, float f2) {
            this.f1863b = eVar;
            this.f1864c = f;
            this.f1865d = f2;
        }

        public void a(Matrix matrix, c.b.a.b.b0.a aVar, int i, Canvas canvas) {
            RectF rectF = new RectF(0.0f, 0.0f, (float) Math.hypot((double) (this.f1863b.f1870c - this.f1865d), (double) (this.f1863b.f1869b - this.f1864c)), 0.0f);
            Matrix matrix2 = new Matrix(matrix);
            matrix2.preTranslate(this.f1864c, this.f1865d);
            matrix2.preRotate(c());
            aVar.b(canvas, matrix2, rectF, i);
        }

        /* access modifiers changed from: package-private */
        public float c() {
            return (float) Math.toDegrees(Math.atan((double) ((this.f1863b.f1870c - this.f1865d) / (this.f1863b.f1869b - this.f1864c))));
        }
    }

    public static class d extends f {
        private static final RectF h = new RectF();
        @Deprecated

        /* renamed from: b  reason: collision with root package name */
        public float f1866b;
        @Deprecated

        /* renamed from: c  reason: collision with root package name */
        public float f1867c;
        @Deprecated

        /* renamed from: d  reason: collision with root package name */
        public float f1868d;
        @Deprecated
        public float e;
        @Deprecated
        public float f;
        @Deprecated
        public float g;

        public d(float f2, float f3, float f4, float f5) {
            q(f2);
            u(f3);
            r(f4);
            p(f5);
        }

        /* access modifiers changed from: private */
        public float j() {
            return this.e;
        }

        /* access modifiers changed from: private */
        public float k() {
            return this.f1866b;
        }

        /* access modifiers changed from: private */
        public float l() {
            return this.f1868d;
        }

        /* access modifiers changed from: private */
        public float m() {
            return this.f;
        }

        /* access modifiers changed from: private */
        public float n() {
            return this.g;
        }

        /* access modifiers changed from: private */
        public float o() {
            return this.f1867c;
        }

        private void p(float f2) {
            this.e = f2;
        }

        private void q(float f2) {
            this.f1866b = f2;
        }

        private void r(float f2) {
            this.f1868d = f2;
        }

        /* access modifiers changed from: private */
        public void s(float f2) {
            this.f = f2;
        }

        /* access modifiers changed from: private */
        public void t(float f2) {
            this.g = f2;
        }

        private void u(float f2) {
            this.f1867c = f2;
        }

        public void a(Matrix matrix, Path path) {
            Matrix matrix2 = this.f1871a;
            matrix.invert(matrix2);
            path.transform(matrix2);
            h.set(k(), o(), l(), j());
            path.arcTo(h, m(), n(), false);
            path.transform(matrix);
        }
    }

    public static class e extends f {
        /* access modifiers changed from: private */

        /* renamed from: b  reason: collision with root package name */
        public float f1869b;
        /* access modifiers changed from: private */

        /* renamed from: c  reason: collision with root package name */
        public float f1870c;

        public void a(Matrix matrix, Path path) {
            Matrix matrix2 = this.f1871a;
            matrix.invert(matrix2);
            path.transform(matrix2);
            path.lineTo(this.f1869b, this.f1870c);
            path.transform(matrix);
        }
    }

    public static abstract class f {

        /* renamed from: a  reason: collision with root package name */
        protected final Matrix f1871a = new Matrix();

        public abstract void a(Matrix matrix, Path path);
    }

    static abstract class g {

        /* renamed from: a  reason: collision with root package name */
        static final Matrix f1872a = new Matrix();

        g() {
        }

        public abstract void a(Matrix matrix, c.b.a.b.b0.a aVar, int i, Canvas canvas);

        public final void b(c.b.a.b.b0.a aVar, int i, Canvas canvas) {
            a(f1872a, aVar, i, canvas);
        }
    }

    public m() {
        m(0.0f, 0.0f);
    }

    private void b(float f2) {
        if (f() != f2) {
            float f3 = ((f2 - f()) + 360.0f) % 360.0f;
            if (f3 <= 180.0f) {
                d dVar = new d(h(), i(), h(), i());
                dVar.s(f());
                dVar.t(f3);
                this.h.add(new b(dVar));
                o(f2);
            }
        }
    }

    private void c(g gVar, float f2, float f3) {
        b(f2);
        this.h.add(gVar);
        o(f3);
    }

    private float f() {
        return this.e;
    }

    private float g() {
        return this.f;
    }

    private void o(float f2) {
        this.e = f2;
    }

    private void p(float f2) {
        this.f = f2;
    }

    private void q(float f2) {
        this.f1858c = f2;
    }

    private void r(float f2) {
        this.f1859d = f2;
    }

    private void s(float f2) {
        this.f1856a = f2;
    }

    private void t(float f2) {
        this.f1857b = f2;
    }

    public void a(float f2, float f3, float f4, float f5, float f6, float f7) {
        d dVar = new d(f2, f3, f4, f5);
        dVar.s(f6);
        dVar.t(f7);
        this.g.add(dVar);
        b bVar = new b(dVar);
        float f8 = f6 + f7;
        boolean z = f7 < 0.0f;
        if (z) {
            f6 = (f6 + 180.0f) % 360.0f;
        }
        c(bVar, f6, z ? (180.0f + f8) % 360.0f : f8);
        double d2 = (double) f8;
        q(((f2 + f4) * 0.5f) + (((f4 - f2) / 2.0f) * ((float) Math.cos(Math.toRadians(d2)))));
        r(((f3 + f5) * 0.5f) + (((f5 - f3) / 2.0f) * ((float) Math.sin(Math.toRadians(d2)))));
    }

    public void d(Matrix matrix, Path path) {
        int size = this.g.size();
        for (int i = 0; i < size; i++) {
            this.g.get(i).a(matrix, path);
        }
    }

    /* access modifiers changed from: package-private */
    public g e(Matrix matrix) {
        b(g());
        return new a(this, new ArrayList(this.h), matrix);
    }

    /* access modifiers changed from: package-private */
    public float h() {
        return this.f1858c;
    }

    /* access modifiers changed from: package-private */
    public float i() {
        return this.f1859d;
    }

    /* access modifiers changed from: package-private */
    public float j() {
        return this.f1856a;
    }

    /* access modifiers changed from: package-private */
    public float k() {
        return this.f1857b;
    }

    public void l(float f2, float f3) {
        e eVar = new e();
        float unused = eVar.f1869b = f2;
        float unused2 = eVar.f1870c = f3;
        this.g.add(eVar);
        c cVar = new c(eVar, h(), i());
        c(cVar, cVar.c() + 270.0f, cVar.c() + 270.0f);
        q(f2);
        r(f3);
    }

    public void m(float f2, float f3) {
        n(f2, f3, 270.0f, 0.0f);
    }

    public void n(float f2, float f3, float f4, float f5) {
        s(f2);
        t(f3);
        q(f2);
        r(f3);
        o(f4);
        p((f4 + f5) % 360.0f);
        this.g.clear();
        this.h.clear();
    }
}
